using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Linq;

namespace Model
{
    public partial class ShopDemoContextt : DbContext
    {
        public ShopDemoContextt()
            : base("name=ShopDemoContextt")
        {
        }

        public virtual DbSet<Address> Address { get; set; }
        public virtual DbSet<Customer> Customer { get; set; }
        public virtual DbSet<LogInfo> LogInfo { get; set; }
        public virtual DbSet<Module> Module { get; set; }
        public virtual DbSet<Order> Order { get; set; }
        public virtual DbSet<OrderDetail> OrderDetail { get; set; }
        public virtual DbSet<Photo> Photo { get; set; }
        public virtual DbSet<Product> Product { get; set; }
        public virtual DbSet<Role> Role { get; set; }
        public virtual DbSet<RoleModule> RoleModule { get; set; }
        public virtual DbSet<RoleUser> RoleUser { get; set; }
        public virtual DbSet<Shopping> Shopping { get; set; }
        public virtual DbSet<sysdiagrams> sysdiagrams { get; set; }
        public virtual DbSet<Type> Type { get; set; }
        public virtual DbSet<User> User { get; set; }
        public virtual DbSet<Record> Record { get; set; }
        public virtual DbSet<V_CustAddress> V_CustAddress { get; set; }
        public virtual DbSet<V_CustOrder> V_CustOrder { get; set; }
        public virtual DbSet<V_CustProductShopp> V_CustProductShopp { get; set; }
        public virtual DbSet<V_Order_OrderDetail> V_Order_OrderDetail { get; set; }
        public virtual DbSet<V_OrderOdetail> V_OrderOdetail { get; set; }
        public virtual DbSet<V_ProductIdPhone> V_ProductIdPhone { get; set; }
        public virtual DbSet<V_UserModuleMessage> V_UserModuleMessage { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Address>()
                .Property(e => e.Nam)
                .IsUnicode(false);

            modelBuilder.Entity<Address>()
                .Property(e => e.Province)
                .IsUnicode(false);

            modelBuilder.Entity<Address>()
                .Property(e => e.City)
                .IsUnicode(false);

            modelBuilder.Entity<Address>()
                .Property(e => e.District)
                .IsUnicode(false);

            modelBuilder.Entity<Address>()
                .Property(e => e.Information)
                .IsUnicode(false);

            modelBuilder.Entity<Address>()
                .Property(e => e.Phone)
                .IsUnicode(false);

            modelBuilder.Entity<Address>()
                .Property(e => e.IsDefault)
                .IsUnicode(false);

            modelBuilder.Entity<Customer>()
                .Property(e => e.CustName)
                .IsUnicode(false);

            modelBuilder.Entity<Customer>()
                .Property(e => e.Pwd)
                .IsUnicode(false);

            modelBuilder.Entity<Customer>()
                .Property(e => e.Sex)
                .IsUnicode(false);

            modelBuilder.Entity<Customer>()
                .Property(e => e.Phone)
                .IsFixedLength();

            modelBuilder.Entity<Customer>()
                .Property(e => e.Isstate)
                .IsUnicode(false);

            modelBuilder.Entity<LogInfo>()
                .Property(e => e.UserName)
                .IsUnicode(false);

            modelBuilder.Entity<LogInfo>()
                .Property(e => e.ModuleName)
                .IsUnicode(false);

            modelBuilder.Entity<LogInfo>()
                .Property(e => e.OperationName)
                .IsUnicode(false);

            modelBuilder.Entity<LogInfo>()
                .Property(e => e.Contents)
                .IsUnicode(false);

            modelBuilder.Entity<LogInfo>()
                .Property(e => e.OperationResult)
                .IsUnicode(false);

            modelBuilder.Entity<LogInfo>()
                .Property(e => e.CreateTime)
                .IsUnicode(false);

            modelBuilder.Entity<Module>()
                .Property(e => e.ModuleName)
                .IsUnicode(false);

            modelBuilder.Entity<Module>()
                .Property(e => e.ControllerName)
                .IsUnicode(false);

            modelBuilder.Entity<Module>()
                .Property(e => e.ActionName)
                .IsUnicode(false);

            modelBuilder.Entity<Order>()
                .Property(e => e.OrderId)
                .IsUnicode(false);

            modelBuilder.Entity<Order>()
                .Property(e => e.CustName)
                .IsUnicode(false);

            modelBuilder.Entity<Order>()
                .Property(e => e.ShouName)
                .IsUnicode(false);

            modelBuilder.Entity<Order>()
                .Property(e => e.ProductName)
                .IsUnicode(false);

            modelBuilder.Entity<Order>()
                .Property(e => e.ToPrice)
                .HasPrecision(18, 0);

            modelBuilder.Entity<Order>()
                .Property(e => e.Province)
                .IsUnicode(false);

            modelBuilder.Entity<Order>()
                .Property(e => e.City)
                .IsUnicode(false);

            modelBuilder.Entity<Order>()
                .Property(e => e.District)
                .IsUnicode(false);

            modelBuilder.Entity<Order>()
                .Property(e => e.Information)
                .IsUnicode(false);

            modelBuilder.Entity<Order>()
                .Property(e => e.IsTake)
                .IsUnicode(false);

            modelBuilder.Entity<Order>()
                .Property(e => e.ProductPrth)
                .IsUnicode(false);

            modelBuilder.Entity<Order>()
                .Property(e => e.Price)
                .HasPrecision(18, 0);

            modelBuilder.Entity<OrderDetail>()
                .Property(e => e.OrderId)
                .IsUnicode(false);

            modelBuilder.Entity<OrderDetail>()
                .Property(e => e.CustName)
                .IsUnicode(false);

            modelBuilder.Entity<OrderDetail>()
                .Property(e => e.ProductName)
                .IsUnicode(false);

            modelBuilder.Entity<OrderDetail>()
                .Property(e => e.ProductPrth)
                .IsUnicode(false);

            modelBuilder.Entity<OrderDetail>()
                .Property(e => e.Price)
                .HasPrecision(18, 0);

            modelBuilder.Entity<Photo>()
                .Property(e => e.PhotoName)
                .IsUnicode(false);

            modelBuilder.Entity<Photo>()
                .Property(e => e.PhotoPath)
                .IsUnicode(false);

            modelBuilder.Entity<Product>()
                .Property(e => e.ProductName)
                .IsUnicode(false);

            modelBuilder.Entity<Product>()
                .Property(e => e.ProductImg)
                .IsUnicode(false);

            modelBuilder.Entity<Product>()
                .Property(e => e.Price)
                .HasPrecision(32, 2);

            modelBuilder.Entity<Product>()
                .Property(e => e.Particulars)
                .IsUnicode(false);

            modelBuilder.Entity<Product>()
                .Property(e => e.Site)
                .IsUnicode(false);

            modelBuilder.Entity<Product>()
                .Property(e => e.Isstate)
                .IsUnicode(false);

            modelBuilder.Entity<Role>()
                .Property(e => e.RoleName)
                .IsUnicode(false);

            modelBuilder.Entity<Shopping>()
                .Property(e => e.ProductName)
                .IsUnicode(false);

            modelBuilder.Entity<Shopping>()
                .Property(e => e.ProductPrth)
                .IsUnicode(false);

            modelBuilder.Entity<Shopping>()
                .Property(e => e.Price)
                .IsUnicode(false);

            modelBuilder.Entity<Shopping>()
                .Property(e => e.Count)
                .IsUnicode(false);

            modelBuilder.Entity<Type>()
                .Property(e => e.TypeName)
                .IsUnicode(false);

            modelBuilder.Entity<User>()
                .Property(e => e.UserName)
                .IsUnicode(false);

            modelBuilder.Entity<User>()
                .Property(e => e.Pwd)
                .IsUnicode(false);

            modelBuilder.Entity<User>()
                .Property(e => e.Sex)
                .IsUnicode(false);

            modelBuilder.Entity<User>()
                .Property(e => e.Isstate)
                .IsFixedLength();

            modelBuilder.Entity<Record>()
                .Property(e => e.Message)
                .IsUnicode(false);

            modelBuilder.Entity<V_CustAddress>()
                .Property(e => e.Nam)
                .IsUnicode(false);

            modelBuilder.Entity<V_CustAddress>()
                .Property(e => e.Province)
                .IsUnicode(false);

            modelBuilder.Entity<V_CustAddress>()
                .Property(e => e.City)
                .IsUnicode(false);

            modelBuilder.Entity<V_CustAddress>()
                .Property(e => e.District)
                .IsUnicode(false);

            modelBuilder.Entity<V_CustAddress>()
                .Property(e => e.Information)
                .IsUnicode(false);

            modelBuilder.Entity<V_CustAddress>()
                .Property(e => e.Phone)
                .IsUnicode(false);

            modelBuilder.Entity<V_CustAddress>()
                .Property(e => e.IsDefault)
                .IsFixedLength()
                .IsUnicode(false);

            modelBuilder.Entity<V_CustOrder>()
                .Property(e => e.OrderName)
                .IsUnicode(false);

            modelBuilder.Entity<V_CustOrder>()
                .Property(e => e.PayPrice)
                .HasPrecision(18, 0);

            modelBuilder.Entity<V_CustOrder>()
                .Property(e => e.Price)
                .HasPrecision(32, 8);

            modelBuilder.Entity<V_CustOrder>()
                .Property(e => e.State)
                .IsFixedLength()
                .IsUnicode(false);

            modelBuilder.Entity<V_CustOrder>()
                .Property(e => e.Province)
                .IsUnicode(false);

            modelBuilder.Entity<V_CustOrder>()
                .Property(e => e.City)
                .IsUnicode(false);

            modelBuilder.Entity<V_CustOrder>()
                .Property(e => e.District)
                .IsUnicode(false);

            modelBuilder.Entity<V_CustOrder>()
                .Property(e => e.Information)
                .IsUnicode(false);

            modelBuilder.Entity<V_CustProductShopp>()
                .Property(e => e.Price)
                .IsUnicode(false);

            modelBuilder.Entity<V_CustProductShopp>()
                .Property(e => e.Count)
                .IsUnicode(false);

            modelBuilder.Entity<V_Order_OrderDetail>()
                .Property(e => e.OrderId)
                .IsUnicode(false);

            modelBuilder.Entity<V_Order_OrderDetail>()
                .Property(e => e.CustName)
                .IsUnicode(false);

            modelBuilder.Entity<V_Order_OrderDetail>()
                .Property(e => e.ShouName)
                .IsUnicode(false);

            modelBuilder.Entity<V_Order_OrderDetail>()
                .Property(e => e.ProductName)
                .IsUnicode(false);

            modelBuilder.Entity<V_Order_OrderDetail>()
                .Property(e => e.ToPrice)
                .HasPrecision(18, 0);

            modelBuilder.Entity<V_Order_OrderDetail>()
                .Property(e => e.Province)
                .IsUnicode(false);

            modelBuilder.Entity<V_Order_OrderDetail>()
                .Property(e => e.City)
                .IsUnicode(false);

            modelBuilder.Entity<V_Order_OrderDetail>()
                .Property(e => e.District)
                .IsUnicode(false);

            modelBuilder.Entity<V_Order_OrderDetail>()
                .Property(e => e.Information)
                .IsUnicode(false);

            modelBuilder.Entity<V_Order_OrderDetail>()
                .Property(e => e.IsTake)
                .IsUnicode(false);

            modelBuilder.Entity<V_Order_OrderDetail>()
                .Property(e => e.Price)
                .HasPrecision(18, 0);

            modelBuilder.Entity<V_Order_OrderDetail>()
                .Property(e => e.ProductPrth)
                .IsUnicode(false);

            modelBuilder.Entity<V_OrderOdetail>()
                .Property(e => e.ProductName)
                .IsUnicode(false);

            modelBuilder.Entity<V_OrderOdetail>()
                .Property(e => e.Price)
                .HasPrecision(18, 0);

            modelBuilder.Entity<V_ProductIdPhone>()
                .Property(e => e.PhotoName)
                .IsUnicode(false);

            modelBuilder.Entity<V_ProductIdPhone>()
                .Property(e => e.PhotoPath)
                .IsUnicode(false);

            modelBuilder.Entity<V_UserModuleMessage>()
                .Property(e => e.UserName)
                .IsUnicode(false);

            modelBuilder.Entity<V_UserModuleMessage>()
                .Property(e => e.Pwd)
                .IsUnicode(false);

            modelBuilder.Entity<V_UserModuleMessage>()
                .Property(e => e.Sex)
                .IsFixedLength();

            modelBuilder.Entity<V_UserModuleMessage>()
                .Property(e => e.Isstate)
                .IsFixedLength();

            modelBuilder.Entity<V_UserModuleMessage>()
                .Property(e => e.ControllerName)
                .IsUnicode(false);

            modelBuilder.Entity<V_UserModuleMessage>()
                .Property(e => e.ActionName)
                .IsUnicode(false);

            modelBuilder.Entity<V_UserModuleMessage>()
                .Property(e => e.ModuleName)
                .IsUnicode(false);
        }
    }
}
